package kr.hyunist.androidcomplete01saeildamil.ch19;

import kr.hyunist.androidcomplete01saeildamil.*;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;

public class ANREx01 extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.anrex);
	}
	
	public void mOnClick(View v){
		switch(v.getId()){
		case R.id.anrexincreasebtn:
			TextView textCounter = (TextView) findViewById(R.id.anrexcountertv);
			int count = Integer.parseInt(textCounter.getText().toString());
			textCounter.setText(Integer.toString(count + 1));
			break;
			
		case R.id.anrexuploadbtn:
			doUpLoad();
			Toast.makeText(ANREx01.this, "업로드를 완료!", 0).show();
			break;
		}
	}

	private void doUpLoad() {
		for(int i = 0; i < 100; i++){
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		
	}
}
